package sawyer;
/** Display.java
 * @author shadowimmage@gmail.com - Chase Sawyer
 *
 * Java 2D graphics integration. Designed to handle the output of the main system to the on-screen
 * display.
 *	Reading: http://docs.oracle.com/javase/tutorial/2d/text/drawmulstring.html
 * Will need to gather data from the local machine about screen dimensions and extract some metadata.
 * - Question: how to set up the basic screen space itself first, then how to extend to Full Screen
 * Exclusive Mode. (use something with JPanel?)
 * 
 */

import processing.core.*;

public class Display extends PApplet {
	private static final long serialVersionUID = -1111105408353572344L; // java wants this...
	
	private Debug debug;
	private static boolean initiated = false;
	private int winWidth;
	private int winHeight;
	
	public Display(Debug d, int w, int h) {
		winWidth = w;
		winHeight = h;
		debug = d;
		setup();
	}
	
	public void setup() {
		size(winWidth, winHeight);
		debug.print("Graphics Setting up...");
		frameRate(20); //Max frame refresh 20x per second (limiting).
//		String[] fontlist = PFont.list(); //List all installed system fonts. #460 on T61 = TNR
//		System.out.println(fontlist);	//display the list of all installed fonts.
		PFont font = createFont("serif", 36, true); // Generate a 24pt antialiased 
		textFont(font);
		rectMode(CENTER);
		background(0);
		debug.print("Graphics finished setting up.");
		initiated = true;
	}
	
	public void draw() {
		background(20);
		text(Main.getParagraph(), width/2, height/2, width-100, height-100);
	}
	
	public static boolean isInitiated() {
		return initiated;
	}
	
	public void close() {
		exit();
	}
}
